package com.maweis;

import android.content.Context;
import android.media.AudioManager;

public class SoundUtil {

	private Context ctx;
	
	
	public SoundUtil(Context ctx){
		this.setCtx(ctx);
	}
	
	public boolean setSilentMode() {
		return setSilentMode(ctx);
	}
		
	public boolean setSilentMode(Context context) {
		boolean result = false;

		AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE) ;
		audioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);
		
		return result;

	}
	
	public boolean setNormalMode() {
		return setNormalMode(ctx);
	}
	
	public boolean setNormalMode(Context context) {
		boolean result = false;

		AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE) ;
		audioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
		
		return result;

	}

	public Context getCtx() {
		return ctx;
	}

	public void setCtx(Context ctx) {
		this.ctx = ctx;
	}
	
	
	
	
	

}
